/*package tcpClient;
import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.SocketException;


public class UDPOutputThread extends Thread {

	private DatagramSocket udpclient;
	private boolean isActive = true;
	private String username = "";
	private String response = "";

	public UDPOutputThread(DatagramSocket client, String hostname) {
		this.udpclient = client;

	}

	public void run() {

		byte[] buf = new byte[256];
		DatagramPacket packet = new DatagramPacket(buf, buf.length);
		while(isActive) {
			try {
				try {
					udpclient.receive(packet);
					response = new String(packet.getData(), 0, packet.getLength());
					if(response.startsWith("!auction-ended ")) {
						//!auction-ended dave 250.00 Super small notebook
						//The auction 'Super small notebook' has ended. dave/You won with 250.00.
						String[] substrings = response.split(" ");
						response = "The auction '";
						String item = "";
						for(int i=3;i<substrings.length;i++) {
							item+=substrings[i];
							if(i<substrings.length-1) item+=" ";
						}
						response += (item+"' has ended. ");
						System.out.println(this.username+" "+substrings[1]);
						if(this.username.equals(substrings[1])) {
							response += ("You won with "+substrings[2]);
						} else {
							response += (substrings[1]+" won with "+substrings[2]);
						}
						response += ".";
					} else if(response.startsWith("!new-bid ")) {
						//!new-bid Super small notebook
						//You have been overbid on 'Super small notebook'
						String[] substrings = response.split(" ");
						String item = "";
						for(int i=1;i<substrings.length;i++) {
							item+=substrings[i];
							if(i<substrings.length-1) item+=" ";
						}
						response = "You have been overbid on '"+item+"'";
						
					}
					System.out.println(response);
				} catch (SocketException e) {
					System.out.println("Connection to server lost.");
					isActive = false;
				}
			} catch (IOException e) {
				isActive = false;
				e.printStackTrace();
			}

		}
	}
	
	public void closeThread() {
		this.isActive=false;
		udpclient.close();
	}

	public void setUsername(String username) {
		if(this.username.equals(username)) {
			this.username = "";
		} else this.username = username;
	}

}
*/